﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WF.DAL;

namespace WF.BusinessObject
{
    public class BOBaseKQ
    {
        string _ConnectionString = System.Configuration.ConfigurationManager.AppSettings["KQConnectionString"];
        SHKQDataContext _DataContext = null;

        /// <summary>
        /// DataContext
        /// </summary>
        public SHKQDataContext DataContext
        {
            get
            {
                if (null == _DataContext) InitializeDataContext();
                return _DataContext;
            }
        }

        /// <summary>
        /// 初始化DataContext
        /// </summary>
        private void InitializeDataContext()
        {
            if (string.Empty == _ConnectionString)
            {
                _DataContext = new SHKQDataContext();
            }
            else
            {
                _DataContext = new SHKQDataContext(_ConnectionString);
            }
        }
    }
}
